package com.example.demo.controller;

import com.example.demo.service.Constants;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author gsq
 * @date 2025/3/10 18:04
 */
@Slf4j
@Controller
public class QrcodeController {

    @GetMapping("/qrcode")
    public ModelAndView qrcode() {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("qrcode"); // 返回的视图名称，对应templates下的文件home.html
        modelAndView.addObject("qrImgBase64", Constants.qrImgBase64);
        return modelAndView;
    }
}
